package com.lp.yuojbackendjudgeservice.judge.codesandbox;


import com.lp.yuojbackendmodel.codesrandbox.ExecutedCodeRequest;
import com.lp.yuojbackendmodel.codesrandbox.ExecutedCodeResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class CodeSandboxProxy implements CodeSandbox{
    private  CodeSandbox codeSandbox;

    public CodeSandboxProxy(CodeSandbox codeSandbox){
        this.codeSandbox = codeSandbox;
    }
    @Override
    public ExecutedCodeResponse executeCode(ExecutedCodeRequest executedCodeRequest) {
        log.info("代码沙箱请求前信息:"+ executedCodeRequest.toString());
        ExecutedCodeResponse executedCodeResponse = codeSandbox.executeCode(executedCodeRequest);
        log.info("代码沙箱请求后信息:"+ executedCodeResponse.toString());
        return executedCodeResponse;
    }
}
